import request from '../index';
import type { IuserLogin, ILoginResult } from './types';
import type { IDataType } from '../types';
enum LoginAPI {
  AccountLogin = '/login',
  UserInfo = '/users/',
  UserMenus = '/role/'
}
export function accountLoginRequest(account: IuserLogin) {
  return request.post<IDataType<ILoginResult>>({
    url: LoginAPI.AccountLogin,
    data: account
  });
}

export function getUserInfoRequest(id: number) {
  return request.get<IDataType>({
    url: LoginAPI.UserInfo + id
  });
}

export function getUserMenusRequest(id: number) {
  return request.get<IDataType>({
    url: LoginAPI.UserMenus + id + '/menu'
  });
}
